use std::collections::HashMap;

/**
    Pd means Producer Description 对产生式的描述序列化辅助描述

    PD 内部含有由 Parser 解析出来的信息，包括 Warning
*/

#[derive(Debug, Clone)]
pub enum PD {
    Keyword(KeywordPd),
    UIntL(UIntLPd),
    Brace(BracePd),
    Semicolon(SemicolonPd),
    Identifer(IdentiferPd),
    Eof(EofPd),
    Operation(OpPd),
    NonTerm(NonTermPd),
}

#[derive(Debug, Clone)]
pub struct KeywordPd {
    pub symbol: String,
    pub name: String,
}

#[derive(Debug, Clone)]
pub struct UIntLPd {
    pub symbol: String,
    pub data_type: String,
    pub src: String,
    pub val: u64,

    pub warn: String,
}

#[derive(Debug, Clone)]
pub struct BracePd {
    pub symbol: char,
}

#[derive(Debug, Clone)]
pub struct SemicolonPd {
    pub symbol: char,
}

#[derive(Debug, Clone)]
pub struct IdentiferPd {
    pub symbol: String,
    pub name: String,
}

#[derive(Debug, Clone)]
pub struct EofPd {
    pub symbol: String,
}

#[derive(Debug, Clone)]
pub struct OpPd {
    pub symbol: char,
    pub n_operand: u32,
}

#[derive(Debug, Clone)]
pub struct NonTermPd {
    pub components: Vec<String>,
    pub prop: HashMap<String, usize>,
}
